/*
 Navicat Premium Data Transfer

 Source Server         : 本地MariDB
 Source Server Type    : MariaDB
 Source Server Version : 110402
 Source Host           : localhost:3308
 Source Schema         : db_test

 Target Server Type    : MariaDB
 Target Server Version : 110402
 File Encoding         : 65001

 Date: 09/06/2024 17:36:10
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for tb_order
-- ----------------------------
DROP TABLE IF EXISTS `tb_order`;
CREATE TABLE `tb_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `order_no` varchar(50) NOT NULL DEFAULT '' COMMENT '订单号',
  `user_id` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
  `user_address` varchar(50) NOT NULL DEFAULT '' COMMENT '买家地址',
  `seller_address` varchar(50) NOT NULL DEFAULT '' COMMENT '卖家地址',
  `asset_address` varchar(50) NOT NULL DEFAULT '' COMMENT '资产合约地址',
  `asset_type` smallint(6) unsigned NOT NULL DEFAULT 0 COMMENT '资产类型（1-ERC721, 2-ERC1155, 3-ERC20）',
  `token_id` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '资产tokenId',
  `amount` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '购买数量',
  `pay_amount` decimal(30,4) unsigned NOT NULL DEFAULT 0.0000 COMMENT '支付金额',
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp() COMMENT '更新时间',
  `is_deleted` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '是否删除(1-是)',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ix_order_no` (`order_no`),
  KEY `ix_order_user_address_asset_address_asset_type` (`user_address`,`asset_address`,`asset_type`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of tb_order
-- ----------------------------
BEGIN;
INSERT INTO `tb_order` VALUES (1, '20240609131111571719', 1, '', '', '', 1, 1, 10, 1000.0000, '2024-06-09 13:11:11', '2024-06-09 13:11:11', 0);
INSERT INTO `tb_order` VALUES (2, '20240609131401359901', 1, '', '', '', 1, 1, 10, 1000.0000, '2024-06-09 13:14:01', '2024-06-09 13:14:01', 0);
INSERT INTO `tb_order` VALUES (3, '20240609131547321580', 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F186', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F187', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 10, 1000.0000, '2024-06-09 13:15:47', '2024-06-09 13:15:47', 0);
INSERT INTO `tb_order` VALUES (4, '20240609131624778115', 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F186', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F187', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 10, 1000.0000, '2024-06-09 13:16:24', '2024-06-09 13:16:24', 0);
INSERT INTO `tb_order` VALUES (5, '20240609131749519107', 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F186', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F187', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 10, 1000.0000, '2024-06-09 13:17:49', '2024-06-09 13:17:49', 0);
INSERT INTO `tb_order` VALUES (6, '20240609131918374429', 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F186', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F187', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 10, 1000.0000, '2024-06-09 13:19:18', '2024-06-09 13:19:18', 0);
INSERT INTO `tb_order` VALUES (7, '20240609132148720380', 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F186', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F187', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 10, 1000.0000, '2024-06-09 13:21:48', '2024-06-09 13:21:48', 0);
INSERT INTO `tb_order` VALUES (8, '20240609132201008392', 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F186', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F187', '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 10, 1000.0000, '2024-06-09 13:22:01', '2024-06-09 13:22:01', 0);
COMMIT;

-- ----------------------------
-- Table structure for tb_user
-- ----------------------------
DROP TABLE IF EXISTS `tb_user`;
CREATE TABLE `tb_user` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `address` varchar(50) DEFAULT '' COMMENT '用户地址',
  `real_name` varchar(255) DEFAULT '' COMMENT '真实姓名',
  `nick_name` varchar(255) DEFAULT '' COMMENT '昵称',
  `age` smallint(5) unsigned DEFAULT 0 COMMENT '年龄',
  `created_at` timestamp NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
  `updated_at` timestamp NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp() COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ak_user_address` (`address`),
  KEY `ix_user_realname` (`real_name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of tb_user
-- ----------------------------
BEGIN;
INSERT INTO `tb_user` VALUES (1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F186', '阳新民', '海阳之新', 38, '2024-06-09 08:01:47', '2024-06-09 08:07:33');
INSERT INTO `tb_user` VALUES (4, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F196', '阳新民222', '海阳之新', 38, '2024-06-09 08:10:28', '2024-06-09 08:10:28');
INSERT INTO `tb_user` VALUES (5, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F197', '阳新民222', '海阳之新', 38, '2024-06-09 08:10:32', '2024-06-09 08:10:32');
INSERT INTO `tb_user` VALUES (6, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F198', '阳新民222', '海阳之新', 38, '2024-06-09 08:10:35', '2024-06-09 08:10:35');
COMMIT;

-- ----------------------------
-- Table structure for tb_user_assets
-- ----------------------------
DROP TABLE IF EXISTS `tb_user_assets`;
CREATE TABLE `tb_user_assets` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '用户ID',
  `asset_address` varchar(50) NOT NULL DEFAULT '' COMMENT '用户地址',
  `asset_type` smallint(6) unsigned NOT NULL DEFAULT 0 COMMENT '资产类型',
  `token_id` int(11) unsigned NOT NULL DEFAULT 0 COMMENT '资产tokenId',
  `amount` int(10) unsigned NOT NULL DEFAULT 0 COMMENT '资产数量',
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp() COMMENT '更新时间',
  `is_deleted` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT '是否删除(1-是)',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `ak_user_assets_user_id_asset_address` (`user_id`,`asset_address`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Records of tb_user_assets
-- ----------------------------
BEGIN;
INSERT INTO `tb_user_assets` VALUES (1, 1, '', 1, 1, 10, '2024-06-09 13:11:11', '2024-06-09 13:11:11', 0);
INSERT INTO `tb_user_assets` VALUES (2, 1, '', 1, 1, 10, '2024-06-09 13:14:01', '2024-06-09 13:14:01', 0);
INSERT INTO `tb_user_assets` VALUES (3, 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 10, '2024-06-09 13:15:47', '2024-06-09 13:15:47', 0);
INSERT INTO `tb_user_assets` VALUES (4, 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 10, '2024-06-09 13:16:24', '2024-06-09 13:16:24', 0);
INSERT INTO `tb_user_assets` VALUES (5, 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 10, '2024-06-09 13:17:49', '2024-06-09 13:17:49', 0);
INSERT INTO `tb_user_assets` VALUES (6, 1, '0xCCF807B5207DC23Bc05fD547c55582B1C2E1F189', 1, 1, 30, '2024-06-09 13:19:18', '2024-06-09 13:22:01', 0);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
